package com.wl4837;

public class HomeTheaterFacade {
    private final Projector projector;
    private final SoundSystem soundSystem;
    private final TheaterLights lights;
    private final DvdPlayer dvdPlayer;

    public HomeTheaterFacade(Projector projector,
                             SoundSystem soundSystem,
                             TheaterLights lights,
                             DvdPlayer dvdPlayer) {
        this.projector = projector;
        this.soundSystem = soundSystem;
        this.lights = lights;
        this.dvdPlayer = dvdPlayer;
    }

    // 一键观看电影
    public void watchMovie(String movie) {
        System.out.println("准备观看电影...");
        lights.dim(10);
        projector.on();
        projector.wideScreenMode();
        soundSystem.on();
        soundSystem.setVolume(50);
        dvdPlayer.on();
        dvdPlayer.play(movie);
    }

    // 一键结束观看
    public void endMovie() {
        System.out.println("结束观看电影...");
        lights.on();
        projector.off();
        soundSystem.off();
        dvdPlayer.off();
    }
}